<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>用户资产</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="description" content="网站描述"/>
    <meta name="keywords" content=""/>
    <meta name="author" content="wangl"/>
    <link rel="icon" href="http://ow9lg82yy.bkt.clouddn.com/24f5c360-485d-4a6d-9468-2a61c353cf37.ico">
    <link rel="stylesheet" href="/static/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="/static/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
    <style type="text/css">
        .layui-form-item .layui-inline {
            width: 33.333%;
            float: left;
            margin-right: 0;
        }

        @media (max-width: 1240px) {
            .layui-form-item .layui-inline {
                width: 100%;
                float: none;
            }
        }

        .layui-form-item .role-box {
            position: relative;
        }

        .layui-form-item .role-box .jq-role-inline {
            height: 100%;
            overflow: auto;
        }

        /***
        *  ztree 图标变成黄色
        */
        .ztree .line {
            line-height: 0;
            border-top: none;
            float: none;
        }

        .ztree li span.button.ico_docu {
            background-position: -110px 0;
            margin-right: 2px;
            vertical-align: top;
        }

        .multiSelect {
            line-height: normal;
            height: auto;
            padding: 4px 10px;
            overflow: hidden;
            min-height: 38px;
            margin-top: -38px;
            left: 0;
            z-index: 99;
            position: relative;
            background: none;
        }

        .multiSelect a {
            padding: 2px 5px;
            background: #908e8e;
            border-radius: 2px;
            color: #fff;
            display: block;
            line-height: 20px;
            height: 20px;
            margin: 2px 5px 2px 0;
            float: left;
        }

        .multiSelect a span {
            float: left;
        }

        .multiSelect a i {
            float: left;
            display: block;
            margin: 2px 0 0 2px;
            border-radius: 2px;
            width: 8px;
            height: 8px;
            background: url(/static/images/close.png) no-repeat center;
            background-size: 65%;
            padding: 4px;
        }

        .multiSelect a i:hover {
            background-color: #545556;
        }

        .layui-field-box a {
            padding: 2px 5px;
            background: #908e8e;
            border-radius: 2px;
            color: #fff;
            display: block;
            line-height: 20px;
            height: 20px;
            margin: 2px 5px 22px 0;
            float: left;
        }

        .layui-field-box a span {
            float: left;
        }

        .boxadd {
            float: left;
            display: block;
            margin: 2px 0 0 2px;
            border-radius: 2px;
            width: 8px;
            height: 8px;
            background-size: 65%;
            padding: 4px;
        }
    </style>
</head>
<body class="childrenBody">
<form class="layui-form"  method="get"
      style="width:80%;">
    <div class="layui-form-item" hidden>
        <label class="layui-form-label">编号</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" id="id" name="id"  >
        </div>
    </div>
    <div class="layui-form-item" hidden>
        <label class="layui-form-label">用户类型</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" id="userType" name="userType"  >
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">编号</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" id="userId" name="userId" readonly="readonly" >
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">姓名</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" id="userRealName" name="userRealName" readonly="readonly" >
        </div>
    </div>
    <div class="layui-form-item" hidden>
        <label class="layui-form-label">币种</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" id="coinTypeId" name="coinTypeId" >
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">币种</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" id="coinTypeName" name="coinTypeName" >
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">活币数量</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" id="aliveCoinCount" name="aliveCoinCount" >
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">休眠币数量</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" id="sleepCoinCount" name="sleepCoinCount" >
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="button" class="layui-btn" onclick="getChange()">修改</button>
            <a class="layui-btn" href="/back/admin/shareholder/searchPage">关闭</a>
        </div>
    </div>
</form>
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/layui/layui.js"></script>
<script type="text/javascript" src="/static/js/wangEditor.min.js"></script>
<script type="text/javascript" src="/static/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/static/js/common.js"></script>
</body>
<script>
    var url = location.search;
    var userId = getParam("userId");
    var userType = getParam("userType");



    function getChange(){

        var id = $("#id").val();
        var coinTypeId = $("#coinTypeId").val();
        var aliveCoinCount = $("#aliveCoinCount").val();
        var sleepCoinCount = $("#sleepCoinCount").val();

        $.ajax({
            url: "/back/admin/admin/capital",
            type: "GET",
            dataType: 'json',
            data:{
                id:id,
                coinTypeId:coinTypeId,
                aliveCoinCount:aliveCoinCount,
                sleepCoinCount:sleepCoinCount
            },

            success: function (BaseDto) {
                console.log(123);
                window.location.href="/back/admin/shareholder/searchPage";
            }
        });
    }
    //获取数据
    $.ajax({
        url: "/back/admin/admin/capitalDetail",
        type: "GET",
        dataType: "json",
        data:{
            userId:userId,
            userType:userType
        },
        success: function (baseDto) {
            loadData(baseDto);
        }
    });


    function loadData(baseDto) {
        if (baseDto.code == ERROR)
            console.log(baseDto.msg);
        else {
            //数据
            var capital = baseDto.data;
            var idInput = $("#id");
            idInput.val(capital.id);
            var userIdInput = $("#userId");
            userIdInput.val(userId);
            var userTypeInput = $("#userType");
            userTypeInput.val(userType);
            var userRealNameInput = $("#userRealName");
            userRealNameInput.val(capital.userRealName);
            var coinTypeNameInput = $("#coinTypeName");
            coinTypeNameInput.val(capital.coinTypeName);
            var aliveCoinCountInput = $("#aliveCoinCount");
            aliveCoinCountInput.val(capital.aliveCoinCount);
            var sleepCoinCountInput = $("#sleepCoinCount");
            sleepCoinCountInput.val(capital.sleepCoinCount);
        }
    }
</script>
</html>